package com.bdqn.tsyyds.controller;

import com.bdqn.tsyyds.entity.BookInfo;
import com.bdqn.tsyyds.repository.BookCategoryRepostiory;
import com.bdqn.tsyyds.repository.BookInfoRepostiory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/role")
public class RoleController {
    @Resource
    BookInfoRepostiory bookInfoRepostiory;

    @Resource
    BookCategoryRepostiory bookCategoryRepostiory;

    @RequestMapping("/list")
    public String RoleList(Model model) {
        List<BookInfo> bookInfos = bookInfoRepostiory.findAll();
        model.addAttribute("bookInfo", bookInfos);
        return "role/list";
    }
}
